package be.bonamis.timesheet.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "prestation_type")
public class PrestationType extends PersistentObject {

	private static final long serialVersionUID = 1L;

	@Column(name = "description", nullable = false)
	private String description;

	@Column(name = "default_time", nullable = false)	
	private int defaultTime;

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getDefaultTime() {
		return defaultTime;
	}

	public void setDefaultTime(int defaultTime) {
		this.defaultTime = defaultTime;
	}

	public static Builder getBuilder(String description,
			int defaultTime) {
		return new Builder(description, defaultTime);
	}

	/**
	 * A Builder class used to create new Person objects.
	 */
	public static class Builder {
		PrestationType built;

		/**
		 * Creates a new Builder instance.
		 * 
		 * @param description
		 *            The description of the created PrestationType object.
		 * @param defaultTime
		 *            The default time of the created PrestationType object.
		 */
		Builder(String description, int defaultTime) {
			built = new PrestationType();
			built.description = description;
			built.defaultTime = defaultTime;
		}

		/**
		 * Builds the new Person object.
		 * 
		 * @return The created Person object.
		 */
		public PrestationType build() {
			return built;
		}
	}

}
